<div class="container">
    <div class="col-md-12">
    	<a href="<?php echo $this->createUrl('/front/lottery/index'); ?>" target="_blank">
		<div class="banner">
        	
			<div class="s11-time">
				<div class="countdown_day" id="countdown_day"></div>
				<div class="countdown_spt" id="countdown_hour"></div>
				<div class="countdown_spt" id="countdown_minute"></div>
				<div class="countdown_spt" id="countdown_second"></div>
			</div>
           	<!--
           	<a href="<?php echo $this->createUrl('/front/index/zhuanchang'); ?>" title="美食专场" target="_blank">
            	<img src="<?php echo Yii::app()->theme->baseUrl; ?>/assets/images/banner.jpg">
           	</a>
           	<a target="_blank" class="banner_311_100" title="秋冬新款" href="<?php echo $this->createUrl('/front/index/qing'); ?>"></a>
           	<a target="_blank" class="banner_378_50" title="美食专场" href="<?php echo  $this->createUrl('/front/index/index',array('cid'=>6)); ?>"></a>
           	<a target="_blank" class="banner_378_50"  title="9.9专场" href="<?php echo $this->createUrl('/front/cat/jj'); ?>"></a>
           	<a target="_blank" class="banner_252_50"  title="天猫专场" href="<?php echo $this->createUrl('/front/index/tmall'); ?>"></a>
           	<a target="_blank" class="banner_252_50"  title="女装专场" href="<?php echo  $this->createUrl('/front/index/index',array('cid'=>1)); ?>"></a>
           	<a target="_blank" class="banner_252_50"  title="母婴专场" href="<?php echo  $this->createUrl('/front/index/index',array('cid'=>3)); ?>"></a>
           	-->
        </div>
        </a>
    </div>
    <?php foreach ($custom_blocks as $block): ?>
        <div class="texuan-col goodlist">
            <div class="col-md-12">
                <div class="title">
                    <h3><i class="front-spt"></i><?php echo $block['block_title']; ?> <small>最高性价比</small></h3>
                </div>
            </div>
            <div class="body row">
                <?php foreach ($block['goods'] as $good): ?>
                    <?php include $this->getViewFile('../lib/goodlist'); ?>
                <?php endforeach; ?>
                <div class="clearfix"></div>
            </div>
        </div>
    <?php endforeach; ?>
    <div class="tehui-col goodlist">
        <div class="col-md-12">
            <div class="title">
                <div class="pull-left">
                    <span class="btn txslide active " id="tx"><em>今日</em>特惠</span> 
                    <!--<span class="btn dj-btn txslide" id="tj"><em>秋冬</em>新款</span>-->
                </div>
                <ul class="pull-right">
                    <li><a href="/front/index/index/sort/add_time.html">新品<i class="front-spt down"></i></a></li>
                    <li><a href="/front/index/index/sort/sales.html">销量<i class="front-spt down"></i></a></li>
                    <li><a href="/front/index/index/sort/promo_price.html">价格<i class="front-spt down"></i></a></li>
                    <li><a href="/front/index/index/page/2.html">更多<i class="front-spt more"></i></a></li>
                </ul>
            </div>
        </div>
        <div class="clearfix"></div>
        <div class="body row txslidebody" id="txbody">
        	<!-- 瀑布流分页参数  -->
        	<a href="javascript:void(0)" class="showmore" data-url="/front/index/ajaxgoods.html" data-page="<?php echo $page; ?>" data-paginal="<?php echo Yii::app()->params->page_size['sault_index']; ?>" data-sum="<?php echo ConfigModel::model()->getConfig('home_num'); ?>"></a> 
        </div>
        <div class="body row txslidebody" id="tjbody">
           
        </div>
        <div class="clearfix"></div>
		<div id="loading" data-ajax="1">
			<img src="<?php echo Yii::app()->theme->baseUrl; ?>/assets/images/loading.gif" style="display:inline;"/>
			<div style="display:inline;">正在加载中...</div>
		</div>
        <div class="pager" id="pager" style="display:none">
            <?php echo $pages; ?>
        </div>
    </div>
</div>
<script>
var pagetype = 'home';
var share_home = true;	//是否显示右侧浮动层
$(document).ready(function() {
	require(['front/homepage']);
	//倒计时方法
	var ref_time_num = setInterval("refs_time()",1000);
});

//刷新倒计时
function refs_time(){
	var time 		= (new Date()).valueOf();
	var double11 	= js_strto_time('2014-11-11 00:00:00');
	var countdown 	= parseInt((double11 - time) / 1000);	//距离开始时间的秒数
	var day			= parseInt(countdown / 3600 / 24);		//距离开始时间的秒数/每小时秒数
	var hour		= parseInt(countdown / 3600 - day * 24);//距离(开始时间的秒数/每小时秒数  - 天数*24) 的余数
	var minute		= parseInt((countdown - parseInt(countdown / 3600 ) * 3600) / 60);
	var second		= parseInt((countdown - parseInt(countdown / 3600 ) * 3600) % 60);
	if(day < 10){
		day = "0"+day;
	}
	$('#countdown_day').html(day);
	if(hour < 10){
		hour = "0"+hour;
	}
	$('#countdown_hour').html(hour);
	if(minute < 10){
		minute = "0"+minute;
	}
	$('#countdown_minute').html(minute);
	if(second < 10){
		second = "0"+second;
	}
	$('#countdown_second').html(second);
	//alert(hour + "@@" + minute + "##" +second);
	//console.log(countdown);
}
//2014-10-15 10:00:00 转时间戳
function js_strto_time(str_time){
    var new_str = str_time.replace(/:/g,'-');
    new_str = new_str.replace(/ /g,'-');
    var arr = new_str.split("-");
    var datum = new Date(Date.UTC(arr[0],arr[1]-1,arr[2],arr[3]-8,arr[4],arr[5]));
    return strtotime = datum.getTime();
}
</script>